{% extends 'layout.html' %}

{% load static %}

{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-3.4.1-dist/css/bootstrap-datetimepicker.min.css' %}">
{% endblock %}


{% block content %}
    <div class="panel panel-default">
        <div class="panel-heading">新建用户</div>
        <div class="panel-body">
            <form method="post" novalidate>
                {% csrf_token %}
                {% for field in form %}
                    <div class="form-group">
                        {% comment %}
                        <label>姓名</label>
                        <input type="text" class="form-control" name="add_name" placeholder="姓名">
                        {% endcomment %}

                        <label>{{ field.label }}</label>
                        {{ field }}
                        <span style="color: red">{{ field.errors.0 }}</span>
                    </div>
                {% endfor %}

                <button type="submit" class="btn btn-primary">提 交</button>

            </form>
        </div>
    </div>

{% endblock %}

{% block js %}
    <script src="{% static 'plugins/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-3.4.1-dist/js/bootstrap-datetimepicker.zh-CN.js' %}"></script>
    <script>
        $(function () {
            $("#id_create_time").datetimepicker({
                format: 'yyyy-mm-dd',
                language: 'zh-CN',
                minView: 'month',//设置时间选择为年月日 去掉时分秒选择
                autoclose: true,//当选择一个日期之后是否立即关闭此日期时间选择器。
                todayHighlight: 1  //如果为true, 高亮当前日期
            })

            $("#id_password").click().alert()
        });
    </script>

{% endblock %}